package com.djb.service.impl;

import com.djb.dao.AllDao;
import com.djb.entity.Goods;
import com.djb.entity.User;
import com.djb.entity.Yxj;
import com.djb.entity.Zt;
import com.djb.service.AllService;
import com.djb.vo.Vo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AllServiceImpl implements AllService {

    @Autowired
    AllDao allDao;

    @Override
    public PageInfo<Goods> list(Vo vo, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Goods> list = allDao.list(vo);
        return new PageInfo<>(list);
    }

    @Override
    public User login(User user) {
        return allDao.login(user);
    }

    @Override
    public int addGoods(Goods goods) {
        return allDao.addGoods(goods);
    }

    @Override
    public List<User> listu() {
        return allDao.listu();
    }

    @Override
    public List<Zt> listz() {
        return allDao.listz();
    }

    @Override
    public List<Yxj> listy() {
        return allDao.listy();
    }

    @Override
    public Goods getByid(Integer id) {
        return allDao.getByid(id);
    }

    @Override
    public int upgoods(Integer id) {
        return allDao.upgoods(id);
    }
}
